<!DOCTYPE html>
<html>
<head>
  {include file="top.tpl"}
</head>
<body class="skin-blue">
<div class="wrapper">
	{include file="bread_crumbs.tpl"}
  	<!--引入面包屑-->
  	<section class="base-setting-wrap">
	  	<div class="row">
			<div class="col-md-12">
				<div class="box">
	                <div class="box-header with-border clearfix">      
						<div class="nav-tabs-custom">
							<ul class="nav nav-tabs">
								<li><a href="/backup/demand">采购需求列表</a></li>
								<li><a href="/backup/demand/reject-list">需求待确认列表</a></li>
								<li><a href="/backup/demand/story-intercept">需求拦截列表</a></li>
								<li class="active"><a href="/backup/log/list">采购需求产生日志</a></li>
							</ul>
						</div>         	
	                	<div class="box-form pull-right form-group-sm">
	                		<p class="pull-right"><a href="javascript:;" class="btn btn-success btn-sm" id="js_toggleSearchBox"><i class="fa fa-search"></i><span class="pl5">搜索选项</span></a></p>
	                	</div>
	                	<div class="clearfix"></div>
						<div class="search-box auto-restore" id="js_searchBox">
							<form method="get" class="form-inline auto-restore">
								<div class="form-group-sm">	
									<p>
									    产品编码:
						                <input type="text" name="goods_sn" value="{$queryParameter['goods_sn']|default:''}">
						                选择存放仓库:
						                <select name="warehouse" id="warehouse_search_select" class="" style="width:150px"></select>
								        &nbsp;	
								         需求产生日期:
										<input type="text" class="form-control js_datePicker date_start" name="start_date" value="{$queryParameter['start_date']|default:''}" placeholder="开始时间">-
										<input type="text" class="form-control js_datePicker date_end" name="end_date" value="{$queryParameter['end_date']|default:''}" placeholder="结束时间">
										<button type="submit" class="btn btn-primary btn-sm">立即搜索</button>											
									</p>							
								</div>
							</form>
						</div>
	                </div>
	                <!-- /.box-header -->
	                <div class="box-body">
	                  <table class="table table-bordered table-striped table-hover">
	                  	<thead>
	                    <tr>
	                      <th >产品编码</th>
	                      <th >仓库</th>
	                      <th >日期</th>
	                      <th >备货规则名称</th>
	                      <th >库存数量</th>
	                      <th >安全库存</th>
	                      <th >计算公式</th>
	                      <th >日均销量</th>
	                      <th >备货天数</th>
	                      <th >备货数量</th>
	                      <th >90天内订单占用量</th>
	                      <th >需求A</th>
	                      <th >需求B</th>
	                      <th >临时需求C</th>
	                      <th>最小备货量(C)</th>
	                      <th >最大备货量(C)</th>
	                      <th >需求C(U1)</th>
	                      <th >最小起订量</th>
	                      <th >需求C(U2)</th>
	                      <th >整箱数</th>
	                      <th >需求C(U3)</th>
	                      <th >最大备货量(B+C)</th>
	                      <th >需求C</th>
	                      <th >备注</th>
	                    </tr>
	                    </thead>	                    
	                    <tbody>
	                   	{foreach from=$backupLogList item="log"}
	                   	<tr>	 						
	                      <td>{$log['goods_sn']}</td>
	                      <td>{$log['warehouse_name']}</td>
	                      <td>{$log['create_date']}</td>
	                      <td>{$log['name']}</td>
	                      <td>{$log['stock']}</td>
	                      <td>{$log['safe_stock']}</td>
	                      <td>{$log['avg_sales_formula_type']}</td>
	                      <td>{$log['mean_sales']}</td>
	                      <td>{$log['backup_days']}</td>
	                      <td>{$log['c_story_backup_init_quantity']}</td>
	                      <td>{$log['the_90_days_order']}</td>
	                      <td>{$log['a_story_quantity']}</td>
	                      <td>{$log['b_story_quantity']}</td>
	                      <td>{$log['after_a_story_limit_c_story_quantity']}</td>
	                      <td>{$log['c_story_min_quantity']}</td>
	                      <td>{$log['c_story_max_quantity']}</td>
	                      <td>{$log['after_max_limit_c_story_quantity']}</td>
	                      <td>{$log['product_min_order']}</td>
	                      <td>{$log['after_min_order_limit_c_story_quantity']}</td>
	                      <td>{$log['product_package_quantity']}</td>
	                      <td>{$log['after_package_quantity_c_story_quantity']}</td>
	                      <td>{$log['product_backup_amount']}</td>
	                      <td>{$log['after_backup_amount_c_story_quantity']}</td>
	                      <td class="c_story_quantity_modify_remark" data-modify-remark="{$log['c_story_quantity_modify_remark']}">{$log['c_story_quantity_modify_remark']|truncate:10:"...":true}</td>							
						</tr>		
	                   {/foreach}
	                    </tbody>			                 
	              	</table>
	                </div>
	                <!-- .box-body -->
	                <div class="box-footer text-center clearfix">
					{$page_link}
	                </div>
	              </div>
			</div>
		</div>
	</section>
 </div>
{include file='foot.tpl'}
<script src="{$js.url}app_widget/warehouse.js"></script>
<script type="text/javascript">
{literal}
$(function(){
	$('.date_start').datetimepicker({
	    format: "yyyy-mm-dd",
        minView:2,
        autoclose: true,
        todayHighlight: false
	}).on('changeDate', function(ev){
        $(".date_end").val("").datetimepicker('setStartDate',$(this).val());
    });
    $('.date_end').datetimepicker({
	    format: "yyyy-mm-dd",
        minView:2,
        autoclose: true,
        todayHighlight: false
	});
})

$("td.c_story_quantity_modify_remark").hover(
  function () {
	var remark = $(this).data('modify-remark');
	if(remark != ''){
		layer.tips(remark, this, {
			skin: 'layui-layer-molv',
			tips: [4, '#3595CC'],
			time:0
		});
	}
  },
  function () {
   layer.closeAll('tips')
  }
);

warehouseSearch2('#warehouse_search_select',GLOBAL.getUrlParam('warehouse'));
{/literal}
</script>

</body>
</html>